﻿using System;
using System.Collections.Generic;

namespace DDDProjectSample.Domain.Repositories
{
    /// <summary>
    /// Contract for TopicRepository component
    /// </summary>
    public interface ITopicRepository : IRepository<Topic>
    {
        /// <summary>
        /// Gets all the topics of a forum
        /// </summary>
        /// <param name="forumId">Id of the forum</param>
        /// <returns>Collection of forum's topics</returns>
        ICollection<Topic> FindByForumId(long forumId);

        /// <summary>
        /// Counts all the topics created by a user, between two dates
        /// </summary>
        /// <param name="userId">Id of the user</param>
        /// <param name="date1">First date and time</param>
        /// <param name="date2">Second date and time</param>
        /// <returns>Number of topics created by the user, between the two dates</returns>
        int CountByUserId(long userId, DateTime date1, DateTime date2);
    }
}
